<!DOCTYPE html>
<!--
This is a starter template page. Use this page to start your new project from
scratch. This page gets rid of all links and provides the needed markup only.
-->
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:th="http://www.thymeleaf.org"
	xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
<head th:replace="top::html" />
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>AdminLTE 2 | Starter</title>
<!-- Tell the browser to be responsive to screen width -->
<meta
	content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
	name="viewport">

<body class="fixed hold-transition skin-blue">
	<div class="wrapper">

		<!-- Main Header -->
		<div th:replace="tophtml::html"></div>
		<!-- Left side column. contains the logo and sidebar -->
		<div th:replace="left::html"></div>

		<!-- Content Wrapper. Contains page content -->
		<div class="content-wrapper">
			<!-- Content Header (Page header) -->
			<section class="content-header">
				<h1>
					<span>添加客户</span> 
                    <small>(<span style="color: red">*</span> 为必填项目)</small>
				</h1>
				<ol class="breadcrumb">
					<li><a href="/index"><i class="fa fa-dashboard"></i>用户中心</a></li>
					<li><a href="/customer/customerList">客户管理</a></li>
					<li><a href="#">添加客户</a></li>
				</ol>
			</section>

			<!-- Main content -->
			<section class="content container-fluid">
				<form th:action="@{/customer/saveCustomer}" method="post"
					th:object="${customer}" id="form1" enctype="multipart/form-data">
					<!-- Content Header (Page header) -->
					
					<div class="form-group">
						<label for="customerName">客户名称</label>
						<span style="color: red">*</span> 
						<input 
							type="text" class="form-control" name="customerName"
							th:value="${customer.customerName}" required>
					</div>

					<div class="form-group">
						<label >客户性质</label> <span style="color: red">*</span> <select
							class="form-control" name="customerNature">
							<option th:each="psd : ${customerNatureList}"
								th:value="${psd.pid}"
								th:selected="${psd.pid eq customer.customerNature}"
								th:text="${psd.worth}">客户性质</option>
						</select>
						<p style="color: red;"
							th:if="${#fields.hasErrors('customerNature')}"
							th:errors="*{customerNature}">Error</p>
					</div>
					
					
					<div class="form-group">
						<label>客户来源</label> <span style="color: red">*</span> <select
							class="form-control" name="customerSource">
							<option th:each="psd : ${customerSourceList}"
								th:selected="${psd.pid eq customer.customerSource}"
								th:value="${psd.pid}" th:text="${psd.worth}">客户来源</option>
						</select>
						<p style="color: red;"
							th:if="${#fields.hasErrors('customerSource')}"
							th:errors="*{customerSource}">Error</p>
					</div>

					<div class="form-group">
						<label>客户类型</label> <span style="color: red">*</span> <select
							class="form-control" name="customerType">
							<option th:each="psd : ${customerTypeList}" th:value="${psd.pid}"
								th:selected="${psd.pid eq customer.customerType}"
								th:text="${psd.worth}">客户类型</option>
						</select>
						<p style="color: red;"
							th:if="${#fields.hasErrors('customerType')}"
							th:errors="*{customerType}">Error</p>
					</div>

					
					<div class="form-group">
						<label for="researchField">所属领域</label>
						<span style="color: red">*</span>
						 <div class="checkbox" th:each="rfd : ${researchFieldDictiontryList}">
                            <label>
                                <input type="checkbox"  name="researchField" th:value="${rfd.names}" th:text="${rfd.worth}" th:checked="${#arrays.contains(researchFieldArr, rfd.names)}" required>
                            </label>
                        </div>
                        <p style="color: red;"
							th:if="${#fields.hasErrors('researchField')}"
							th:errors="*{researchField}">Error</p>
					</div>
					
					<div class="form-group">
					<p style="color: red;"
							th:if="${#fields.hasErrors('area')}"
							th:errors="*{area}">Error</p>
                        <label>国内国外</label>
                        <span style="color: red">*</span>
                        <p style="color: red;" th:text="${domesticOrForeign}"></p>
                        <div class="radio">
                            <label>
                                <input type="radio" name="domesticOrForeign" id="optionsRadios1" value="0"  checked> 国内
                            </label>
                        </div>
                        <div class="radio">
                            <label>
                                <input type="radio" name="domesticOrForeign" id="optionsRadios2" value="1" > 国外
                            </label>
                        </div>
                    </div>
                    

					<div class="form-group form-area">
						<label>省</label> <span style="color: red">*</span>
						<p style="color: red;" th:text="${area}"></p>
						<select class="form-control form-area required" id="provinceId">
							<option value="-1">--选择省--</option>
							<option th:each="list:${provinceDictiontryList}"
								th:value="${list.names}" th:text="${list.worth}"
								th:selected="${list.names eq province}"></option>
						</select>
					</div>
					<div class="form-group form-area">
						<label>市</label> <select class="form-control form-area"
							id="cityId">
							<option value="-1">--选择市--</option>
							<option th:each="list:${cityDictiontryList}"
								th:value="${list.names}" th:text="${list.worth}"
								th:selected="${list.names eq cityId}"></option>
						</select>
					</div>
					<div class="form-group form-area">
						<label>区</label> <select class="form-control form-area"
							id="areaId">
							<option value="-1">--选择区--</option>
							<option th:each="list:${areaDictiontryList}"
								th:value="${list.names}" th:text="${list.worth}"
								th:selected="${list.names eq areaId}"></option>
						</select>
					</div>
					
					<div class="form-group form-country">
                        <label>国家</label>
                        <span style="color: red">*</span>
                        <p style="color: red;" th:text="${area}"></p>
                        <select class="form-control form-area">
                            <option value="-1">--选择国家--</option>
                            <option  th:each="list:${countryDictiontryList}" th:selected="${list.pid eq countryId}" th:value="${list.pid}" th:text="${list.worth}"></option>
                        </select>
                    </div>
					
					<div class="form-group">
						<label>主营业务</label> <input type="text" class="form-control"
							th:value="${customer.mainBusiness}" name="mainBusiness">
					</div>


					<div class="form-group">
						<label>主要需求</label> <input type="text" class="form-control"
							th:value="${customer.majorNeeds}" name="majorNeeds">
					</div>
					
					<div class="form-group">
						<label for="exampleInputFile">附件</label> <input type="file"
							name="customerFiles" id="customerFiles">
					</div>
					
					<div class="form-group">
						<label>最新进展</label> 
						<textarea class="form-control" th:value="${customer.evolve}" name="evolve"></textarea>
					</div>
					
					<div class="form-group">
						<label>历史合作情况</label> 
						<textarea class="form-control" name="historywork" th:value="${customer.historywork}"></textarea>
					</div>

                     <div class="form-group">
						<label>意向合作方式1</label> <select class="form-control"
							name="intentionCooperate2">
							<option th:each="psd : ${intentionCooperateList2}"
							th:selected="${psd.pid eq customer.intentionCooperate2}"
								th:value="${psd.pid}" th:text="${psd.worth}">意向合作方式</option>
						</select>
					</div>

					<div class="form-group">
						<label>意向合作方式2</label> <select class="form-control"
							name="intentionCooperate">
							<option th:each="psd : ${intentionCooperateList}"
							th:selected="${psd.pid eq customer.intentionCooperate}"
								th:value="${psd.pid}" th:text="${psd.worth}">意向合作方式</option>
						</select>
					</div>

					<div class="form-group">
						<label>当前合作状态</label> <select class="form-control"
							name="currentState">
							<option th:each="psd : ${currentStateList}" th:value="${psd.pid}"
							th:selected="${psd.pid eq customer.currentState}"
								th:text="${psd.worth}">当前合作状态</option>
						</select>
					</div>
					
					<div class="form-group">
						<label>备注1</label> <input type="text" class="form-control"
							th:value="${customer.remark1}" name="remark1">
					</div>
					
					<div class="form-group">
						<label>备注2</label> <input type="text" class="form-control"
							th:value="${customer.remark2}" name="remark2">
					</div>


					<div style="width:240px; height: 30px; position:fixed;left:725px;bottom:10px;">
						<button type="submit" class="btn btn-primary">保存</button>
						<button type="reset" class="btn btn-primary" style="margin-left: 30px;">重置</button>
						<button type="button" class="btn btn-primary" onclick="window.history.go(-1)" style="margin-left: 30px;">返回</button>
					</div>
					
				</form>
			</section>
			<!-- /.content -->
		</div>
		<!-- /.content-wrapper -->

		<!-- Main Footer -->
		<div th:replace="footer::html"></div>
		<div class="control-sidebar-bg"></div>
	</div>
<div th:replace="bottom::html" ></div>
</body>

</html>